//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Lesser General Public License for more details.
// 
// You should have received a copy of the GNU Lesser General Public License
// along with this program.  If not, see http://www.gnu.org/licenses/.
// 

import inet.nodes.inet.Router;

module ISP extends Router
{

    parameters:
        int id;
        volatile int nHops;
        //string address;
        @display("i=device/router_vs");

}

module RealISP {

	parameters:
		int nRouters;
		@display("i=misc/cloud_s");
	
	gates:
		inout ext[];
	
	submodules:
		routers[nRouters]: Router;
	
	connections allowunconnected:
		for i=1..nRouters-1 {
			routers[i].pppg++ <--> {ber=0;per = 0;} <--> routers[intuniform(0,i-1)].pppg++;			
		}
		
		for i=0..sizeof(ext)-1 {
			routers[intuniform(0,nRouters-1)].pppg++ <--> ext[i];
		}
}
